Cavity qubit full hamiltonian


In [16]:
%pylab inline
%load_ext autoreload
from MyUnits import *
from MyFunctions import *
from qutip import *
from MyQubit import *
import mpld3
# %aimport MyQubit

%autoreload 2


Populating the interactive namespace from numpy and matplotlib
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
WARNING: pylab import has clobbered these variables: ['identity', 'shape', 'copy', 'entropy', 'info', 'pylab', 'squeeze']
`%matplotlib` prevents importing * from pylab and numpy

Parameters


In [2]:
h = 6.62606957e-34 # Planck Contant
hbar = h/(2*pi) # Planck Constant over 2 Pi
heV = 4.136E-15 # h in eV
qe = 1.60217657e-19 # Electric Charge
hbar = h/2/pi
DelAl = 0.180e-3 * qe # V
kB = 1.3806488e-23 # Boltzmann Constant
e0 = 8.854e-12 # Permittivity vacuum, F/m

In [3]:
N = 10

In [39]:
wr = (5.0) * 2* pi
# wge = 4.4 * 2 * pi
# wef = 4.3 * 2 * pi
g_ge = 0.1 * 2 * pi
g_ef = 0.2 * 2 * pi
Gamma_s = 0.0002635497665 * 2* pi
Gamma_d = 0.000308010154756 * 2 * pi
wg = 0.1 *2 * pi
we = 4.4 * 2 * pi
wf = 8.0 * 2 * pi

In [40]:
kappa_n = 0.00025245000000000004 * 2 * pi
gamma_rel = 0.00023255813953488373 * 2 * pi
gamma_dep = 0.0011403579916684755 * 2 * pi
n_th_a = 0.02238770514 * 2 * pi

In [41]:
# b_f = basis(3, 0)
# b_e = basis(3, 1)
# b_g = basis(3, 2)

# s_gg = tensor(qeye(N), b_g * b_g.dag())  # |e><e|
# s_ee = tensor(qeye(N), b_e * b_e.dag())  # |e><e|
# s_ge = tensor(qeye(N), b_g * b_e.dag())  # |g><e|
# s_ef = tensor(qeye(N), b_e * b_f.dag())  # |e><f|


# I = tensor(qeye(N), qeye(3))

In [42]:
# # cavity operators
# a = tensor(destroy(N), qeye(3))
# nc = a.dag() * a
# xc = a + a.dag()

# #Hamiltonian

# Hr = wr * (a.dag() * a + I/2) 
# Hq = wge*(s_gg) + wef * s_ee
# Hint = Lge * ( a.dag()*s_ge + a * s_ge.dag()) + Lef * (a.dag()*s_ef + a*s_ef.dag())
# Hd = (Gamma_d/2.0) * (a + a.dag())
# Hs = (Gamma_s/2.0) * (s_ge + s_ge.dag())

# H = Hr + Hq + Hint + Hd + Hs


#  Initial State
#     psi0 = tensor(ket2dm(basis(N,0)), ket2dm(basis(2,0))).unit()

In [43]:
# collapse operators

# c_op_list = []




# rate = kappa_n * (1 + n_th_a)
# if rate > 0.0:
#     c_op_list.append(sqrt(rate) * a)

# rate = kappa_n * n_th_a
# if rate > 0.0:
#     c_op_list.append(sqrt(rate) * a.dag())

# rate = gamma_rel * (1 + n_th_a)
# if rate > 0.0:
#     c_op_list.append(sqrt(rate) * s_ge.dag())

# rate = gamma_rel * (n_th_a)
# if rate > 0.0:
#     c_op_list.append(sqrt(rate) * s_ge)   

# rate = gamma_dep/2 * (1 + n_th_a)
# if rate > 0.0:
#     c_op_list.append(sqrt(rate) * (s_ge + s_ge.dag()))    


# #     A = sz.dag()
# #     B = sz
# #     spec = []

# rho    = steadystate(H,c_op_list)
# rho_sz = rho * (s_ge + s_ge.dag())
# rho_n  = rho * (a.dag()*a )
# rho_x  = rho * (a.dag() + a)
# rho_a  = rho * a


# calculate the power spectrum
#     corr_vecq = correlation_2op_2t(H, psi0, None, tlist, c_op_list, A, B,solver="me")

#     print("Correlation Done!")

#     w1, S1 = spectrum_correlation_fft(tlist, corr_vecq)

#     print( "Spectrum Done!")

#     return w1, S1, result

In [44]:
# dispersive hamiltonian
# H = wr * (a.dag() * a + I/2.0) + (wq / 2.0) * sz + chi * (a.dag() * a + I/2) * sz

Initial state


In [45]:
# rho_sz.tr(), rho_n.tr(), rho_x.tr(), rho_a.tr()

In [20]:
rho,temp, temp2, temp3, temp4 = full_H(N,wr, wge, wef, Lge, Lef, Gamma_d,Gamma_s, kappa_n,gamma_rel,gamma_dep,n_th_a)

In [26]:
abs(temp.tr()),abs(temp2.tr()),abs(temp3.tr()),abs(temp4.tr())


Out[26]:
(0.0003425657942024732,
 0.14222644993789574,
 5.469739822632287e-05,
 2.7348699338574172e-05)

In [47]:
N = 5 # number of states cavity
Q_c = 20000
Q_l = 20000
w_r_tilde = 5.065 * 2 * pi
w_ge_tilde = 4.36 *2 * pi
P_cavity = -(106 + 32) # Input power cavity

Gamma_d = sqrt(Q_c*kappa_n*1e9*dBmtoW(P_cavity)/(2*Q_l*hbar*w_r_tilde*1e9))/1e9  # Drive amplitude qubit
print('Drive amplitude cavity =',Gamma_d/2/pi, 'GHz')

# w_s = 2 * pi * linspace(f_s_i,f_s_f,steps_s)


f_d_i = 5.058 # cavity initial frequency 
f_d_f = 5.062# cavity final frequency
steps_d = 50
w_d = 2 * pi * linspace(f_d_i,f_d_f,steps_d)

f_s_i = 4.2 # qubit initial freq
f_s_f = 4.4  # qubit final freq
steps_s = 50
w_s = 2 * pi * linspace(f_s_i,f_s_f,steps_s)

amp_sz = []
amp_n = []
amp_x = []
for wr in w_d:
    
    for wq in w_s:
        
       
        rho,temp, temp2, temp3, temp4 = full_H(N,wr, wg, we, wf, g_ge, g_ef, Lge, Lef, Gamma_d,Gamma_s, kappa_n,gamma_rel,gamma_dep,n_th_a)
        amp_sz.append((temp.tr()))
        amp_n.append((temp2.tr()))
        amp_x.append((temp3.tr()))
        amp_a.append((temp4.tr()))
        





# for Pq in P_qubit:
    
#     for wq in w_s:
        
        
#         Delta_s_tilde = w_ge_tilde - wq
#         Gamma_s = sqrt(Q_c*kappa_n*1e9*dBmtoW(Pq)/(2*Q_l*hbar*w_ge_tilde*1e9))/1e9

#         rho,temp, temp2, temp3, temp4 = full_H(N,wr, wge, wef, Lge, Lef, Gamma_d,Gamma_s, kappa_n,gamma_rel,gamma_dep,n_th_a)
#         amp_sz.append((temp.tr()))
#         amp_n.append((temp2.tr()))
#         amp_x.append((temp3.tr()))
#         amp_a.append((temp4.tr()))


Drive amplitude cavity = 0.000308010154756 GHz

In [55]:
Tr_sz = reshape(amp_sz,(-1,len(w_s+1)))
Tr_n  = reshape(amp_n ,(-1,len(w_s+1)))
Tr_x  = reshape(amp_x ,(-1,len(w_s+1)))
Tr_a  = reshape(amp_a ,(-1,len(w_s+1)))

In [60]:



Out[60]:
1.000000000000001

In [57]:
fig, ax = subplots(2,2, figsize=(16,10))

im = ax[0,0].pcolor( w_s/2/pi,w_d/2/pi,abs(Tr_sz))#,vmin=0, vmax=1)
fig.colorbar(im, ax=ax[0,0])
ax[0,0].set_xlim(4.27,4.39)
ax[0,0].set_ylim(P_i,P_f)
ax[0,0].set_ylabel(r'Qubit Tone Power(dBm)',fontsize=10)
ax[0,0].set_xlabel(r'Qubit Tone Frequency (GHz)',fontsize=10)
ax[0,0].set_title(r'$Tr[\rho\sigma_z]$',fontsize=20)


im2 = ax[0,1].pcolor(w_s/2/pi,w_d/2/pi,abs(Tr_n))#,vmin=0, vmax=1)
fig.colorbar(im2, ax=ax[0,1])
ax[0,1].set_ylim(P_i,P_f)
ax[0,1].set_xlim(4.27,4.39)
ax[0,1].set_ylabel(r'Qubit Tone Power(dBm)',fontsize=10)
ax[0,1].set_xlabel(r'Qubit Tone Frequency (GHz)', fontsize=10)
ax[0,1].set_title(r'$Tr[\rho {a^{\dagger}a}]$',fontsize=20)

im3 = ax[1,0].pcolor(w_s/2/pi,w_d/2/pi,abs(Tr_x))#,vmin=0, vmax=1)
fig.colorbar(im2, ax=ax[1,0])
ax[1,0].set_ylim(P_i,P_f)
ax[1,0].set_xlim(4.27,4.39)
ax[1,0].set_ylabel(r'Qubit Tone Power(dBm)',fontsize=10)
ax[1,0].set_xlabel(r'Qubit Tone Frequency (GHz)', fontsize=10)
ax[1,0].set_title(r'$Tr[\rho (a^{\dagger} + a)]$',fontsize=20)

im3 = ax[1,1].pcolor(w_s/2/pi,w_d/2/pi,abs(Tr_x))#,vmin=0, vmax=1)
fig.colorbar(im2, ax=ax[1,1])
ax[1,1].set_ylim(P_i,P_f)
ax[1,1].set_xlim(4.27,4.39)
ax[1,1].set_ylabel(r'Qubit Tone Power(dBm)',fontsize=10)
ax[1,1].set_xlabel(r'Qubit Tone Frequency (GHz)', fontsize=10)
ax[1,1].set_title(r'$Tr[\rho a]$',fontsize=20)


Out[57]:
<matplotlib.text.Text at 0x10f0440b8>

In [ ]: